Skip to content

feat(id-render): assertion half of stage 2 — consume the #5850 vocabulary (#12836) - #12857

Merged
dezren39 merged 3 commits into
mainfrom
felix/12836-assertion-half
Nov 23, 2026
Merged

dezren39 merged 3 commits into
mainfrom
felix/12836-assertion-half

Conversation

@dezren39

@dezren39 dezren39 commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

Summary

Discharges the #5855 assumption A2 deferral — the unblocked remainder of #7918, filed as #12836. The assert slot is no longer carried opaquely: the #5850 assertion vocabulary is consumed as versioned data, stage 2 validates the slot against it, stage 3 composes it, and all three targets lower and account for it.

Judgment calls (flagged for review)

  1. Slot syntax — no record pins a concrete string syntax; id: design: style assertion vocabulary (from #5679) #5850 §2 fixes the model (a (dimension, role-value) pair). The grammar chosen is the minimal transcription: comma-separated dimension token pairs. Recorded in the module docs.
  2. Emphasis domain — id: design: style assertion vocabulary (from #5679) #5850's record names primary/destructive in its §2 examples; the domain is completed as (primary, destructive, subtle) from the parent id: design: Markup & styling model for programs-as-websites — semantic markup, style-override mapping #5679 vocabulary line and the id: design: web rendering: assertion → Tailwind mapping (from #5679) #5851 §3.5 / id: design: native rendering: assertion → OS-standard controls (from #5679) #5852 §3.4 tables, which both carry exactly those three.
  3. State-qualified assertions are not in the grammar — id: design: style assertion vocabulary (from #5679) #5850 §5 fixes states as target-derived deltas with fixed precedence ("authors never assert per-state colours directly"); the state roles stay with the targets' state machinery (gui_table).
  4. GUI report extension — the one report-shape change, justified above; the acceptance requires per-target report accounting for assertions and the GUI report had none.

Evidence

Venue, stated plainly: the build-lock queue is stalling under the current scale-up load, so tests ran on amd-6 in a private worktree (~/code-12836) with a private target dir (CARGO_TARGET_DIR=~/code-12836-target), the same approach as the #7918 verification lane. No new dependencies.

  • cargo test -p id-render on the PR head (6d979c3): 68 integration tests pass, 0 fail — the pre-existing 56 (pipeline 15, compose 11, lower 12, lower_gui 8, lower_native 10) plus 12 new in tests/assertions.rs, each naming the decision-record behaviour it verifies.
  • Fail-before: three probe tests written against pristine main's existing public API only (unknown token must fail validation; raw value must fail validation; a source assertion must reach the web artefact + report) — 3/3 failed on pristine main (the slot was accepted and ignored), 3/3 pass with this change. The committed test file additionally cannot compile on main, since assertion_vocabulary is part of the change.
  • Worked example (in the tests): one assertion-bearing source — page tone surface-base, heading text heading, card elevation elevation-raised, pad space-3, button tone accent, emphasis primary — lowers on web (classes bg-surface-base, text-step-plus-2, shadow, p-space-3, bg-accent; all five assertions reported mapped, none defaulted), on mac (tone accent mapped to controlAccentColor; an added corner corner-rounded reported platform-defaulted per id: design: native rendering: assertion → OS-standard controls (from #5679) #5852 §3.7, never silent), and on GUI (assertions accounted standard; with an asset override on the button, its assertions are accounted superseded-by-presentation while the card's stay standard).
  • cargo fmt -p id-render --check clean; cargo clippy -p id-render --all-targets exits 0 with no warnings in the new/changed code (the crate's pre-existing warning baseline elsewhere is unchanged; the one warning the new test file initially introduced was fixed).

Closes out the code side of #12836; #7918's remainder is discharged by this PR.


Run Proof on this PR
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

felix added 3 commits November 23, 2026 03:42
…lary (#12836)

The #5855 assumption A2 deferral is discharged now #5850 is
settled: the assertion vocabulary lands as versioned data
(src/assertion_vocabulary.rs, transcribed from the #5850
decision record), stage 2 validates the assert slot against it
(unknown dimension/token fails with suggestions in the #5849
idiom; raw values rejected per #5850 invariant 1; a dimension
asserted twice in one slot is an error per #5854 §2.2; the slot
does not apply to raw regions per #5849 §3.1), and stage 3
composes the slot's assertions at instance specificity alongside
the caller-supplied data. Lowering honours them through the
existing per-target tables; the GUI report now accounts for
every resolved assertion by disposition under the presentation
decision (#5854 §2.1 layer 4). Stale crate docs corrected
(lib.rs and the Cargo.toml header no longer claim first stages
or an unsettled #5850).

Tests: tests/assertions.rs, 12 tests naming the decision-record
behaviours they verify, including the assertion-bearing worked
example lowered on all three targets.
Clears the one clippy warning the new test file introduced
(items_after_statements); the crate's pre-existing warning
baseline is unchanged.
@dezren39
dezren39 requested a review from a team as a code owner November 23, 2026 03:57
@coderabbitai

coderabbitai Bot commented Nov 23, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 33 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7d554218-dc7c-49f1-b9c7-a486b48a8682
Commits

Reviewing files that changed from the base of the PR and between a3ab4c5 and 6d979c3.

Files selected for processing: 9

  • pkgs/id/crates/id-render/Cargo.toml
  • pkgs/id/crates/id-render/src/assertion_vocabulary.rs
  • pkgs/id/crates/id-render/src/compose.rs
  • pkgs/id/crates/id-render/src/lib.rs
  • pkgs/id/crates/id-render/src/lower.rs
  • pkgs/id/crates/id-render/src/lower_gui.rs
  • pkgs/id/crates/id-render/src/lower_native.rs
  • pkgs/id/crates/id-render/src/validate.rs
  • pkgs/id/crates/id-render/tests/assertions.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@dezren39
dezren39 merged commit 025483c into main Nov 23, 2026
2 checks passed
@dezren39
dezren39 deleted the felix/12836-assertion-half branch November 23, 2026 03:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant